<?php
	$obj=new Menu();
	$mod=new Module();
	$obj->loadByKey($id);
	
	include("FCKeditor/fckeditor.php");
?>
<form name="f" action="?module=<?php echo $module?>&action=process&mode=update" method="post" enctype="multipart/form-data">
<div class="ContentTitle">
    <div class="left" style="padding-top:8px"><?php echo $objModule->ModuleName?></div>
    <div class="CMSButton right">
        <a onclick="f.submit()">Save</a>
        <a href="?module=<?php echo $module?>">Cancel</a>
    </div>    
    <div class="clear"></div>
</div>
<ul id="ContentTabs" class="shadetabs">
    <li><a id="linkTab1" onclick="ShowHideDiv('Tab',1,2,'link')" class="selected">Overview</a></li>
    <!--<li><a id="linkTab2" onclick="ShowHideDiv('Tab',2,2,'link')">Viet nam</a></li>-->
	<!--<li><a id="linkTab3" onclick="ShowHideDiv('Tab',3,4,'link')">English</a></li>
    <li><a id="linkTab4" onclick="ShowHideDiv('Tab',4,4,'link')">Photo</a></li>-->
</ul>  

<div class="clear"></div>
<div id="Tab1" class="TabContainer ngt_Product" >
    <table width="100%" border="1">
    	<table width="100%">
                <input type="hidden" name="MenuID" value="<?php echo $obj->MenuID?>"/>
    	<tr>
            <td>
                Menu Parent:
            </td>
            <td>
                <?php echo $obj->cbMenu("MenuParent","",$obj->MenuParent)?>
            </td>
		</tr>
		<tr>
            <td width="10%">
                Menu Name:
            </td>
            <td>
                <input type="text" name="MenuName" value="<?php echo $obj->MenuName?>" />
            </td>
        </tr>
		<tr>
			<td>
				Type:
			</td>
			<td>
				<?php echo $obj->cbListType("ModuleID",$obj->ModuleID)?>
			</td>
		</tr>
        <tr>
            <td width="10%">
                Tiêu đề
            </td>
            <td>
                <input type="text" name="Title" value="<?php echo $obj->Title?>" />
            </td>
        </tr>
		<tr>
            <td width="10%">
                Tóm tắt:
            </td>
            <td>
                <textarea name="MenuUrl"><?php echo $obj->MenuUrl?></textarea>
            </td>
        </tr>
        <tr>
            <td width="10%">
                Keywords:
            </td>
            <td>
                <textarea name="Param"><?php echo $obj->Param?></textarea>
            </td>
        </tr>
		
        <tr>
            <td width="10%">
                Position:
            </td>
            <td>
                <input type="text" name="Pos" value="<?php echo $obj->Pos?>" />
            </td>
        </tr>
        <tr>
		<td>Hình ảnh: </td>
		<td>
			<table class="tbimg">
				<tr>
					<td>
						<input type="file" name="image" />
					</td>
					<td>
						<img src="<?php echo $obj->Direc.$obj->MenuID."/".$obj->Image?>" width="100" />
					</td>
				</tr>
			</table>
		</td>
	</tr>
    </table>
     
</div> 
<div class="clear"></div>
<div id="Tab2" class="TabContainer ngt_Product" style="display:none" >
	<table width="100%" border="1">
         
        <tr> 
            <td colspan="2">
                <?php
                $oFCKeditor = new FCKeditor('MenuDetail');
                $oFCKeditor->BasePath = 'FCKeditor/';
                $oFCKeditor->Width  = '100%' ;
                $oFCKeditor->Height = '300' ;
                $oFCKeditor->Value = $obj->MenuDetail;
                $oFCKeditor->Create() ; 
                ?>
            </td>
        </tr>
    </table>
</div>    
<div id="Tab3" class="TabContainer ngt_Product" style="display:none">
    <table width="100%" border="1">
        <tr>
            <td width="10%">
                Menu Name:
            </td>
            <td>
                <input type="text" name="MenuNameEng" value="<?php echo $obj->MenuNameEng?>" />
            </td>
        </tr>
        
        <tr>
            
            <td colspan="2">
                <?php
                $oFCKeditor = new FCKeditor('MenuDetailEng');
                $oFCKeditor->BasePath = 'FCKeditor/';
                $oFCKeditor->Width  = '100%' ;
                $oFCKeditor->Height = '300' ;
                $oFCKeditor->Value = $obj->MenuDetailEng;
                $oFCKeditor->Create() ; 
                ?>
            </td>
        </tr>
    </table>
</div>
<div id="Tab4" class="TabContainer ngt_Product" style="display:none">
<table border="1">
            	<thead>
            	<tr>
                	<th style="text-align:center" width="200px">Hình</th>
                    

                    <th width="20px"></th>                    
                </tr>
               
                </thead>
              
            	<tbody id="tblOptionValue">
<?php
	for($i=0;$i<count($subimage);$i++)
	{
?>
				<tr id="Row<?php echo $i+1?>" class="edit">
					<td>
						<table class="tbimg">
							<tr>
								<td>
									<input id="subimageRow<?php echo $i+1?>" type="file" name="subimageRow<?php echo $i+1?>"/>
								</td>
								<td>
									<img src="<?php echo $obj->Direc.$obj->MenuID."/thumbs/".$subimage[$i]['Image']?>" width="100" />
								</td>
							</tr>
						</table>
					</td>
					<td>
						<a id="deleteRow1" onclick="deleteOptionValue('Row<?php echo $i+1?>')">[Delete]</a>
						<input type="hidden" name="Rows[<?php echo $i+1?>]" value="<?php echo $subimage[$i]['ID']?>"/>
					</td>
				</tr>
<?php
	}
?>
                </tbody>     
		                        
                <tfoot>
				<tr class="add">
					<td align="center" colspan="2">
					   <a href="#" onclick="addOptionValue()">[Add]</a>
					</td>
                </tr>     
                    
                      
                </tfoot>             

		</table>

</div>

<!-------------END CONTENT OF EACH MODULE ---------------------------->

</form>